use serde::Deserialize;
use serde::Serialize;

use strum_macros::EnumIter;
use tauri_plugin_shell::process::CommandChild;
use tauri_plugin_shell::Error;

#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone, EnumIter)]
pub enum Command {
    Web,
    Cron,
    Lab,
    Vista,
}

pub struct Service(CommandChild);
impl Service {
    pub fn new(cmd: CommandChild) -> Self {
        Self(cmd)
    }
    pub fn kill(self) -> Result<(), Error> {
        self.0.kill()
    }
}
